public class t3_new_dome {
    public static void main(String[] args) {
        String s = "pwwkew";
        char arr[] = s.toCharArray();
        int max = 0;
        for(int i =0;i<s.length();i++){//头指针
            int len = 1;
            aa: for(int j =i+1;j<s.length();j++){//尾指针
                for(int k = j-1;k>=i;k--){
                    if(arr[k]==arr[j]){
                        break aa;
                    }
                }
                len++;
            }
            max = Math.max(max,len);
        }
        //return max;
        System.out.println(max);
    }
}
